package com.hdyg.sixg.mvp.presenter;

import com.hdyg.sixg.entry.WalletBean;
import com.hdyg.sixg.httpUtil.HttpCallback;
import com.hdyg.sixg.mvp.Contrant.CSmartWallet;
import com.hdyg.sixg.mvp.base.BasePresenter;
import com.hdyg.sixg.util.ToastUtil;
import java.util.Map;

/**
 * @author CZB
 * @describe 智能钱包
 * @time 2019/4/11 9:54
 */
public class PSmartWallet extends BasePresenter implements CSmartWallet.IPSmartWallet {

    private CSmartWallet.IVSmartWallet mView;

    public PSmartWallet(CSmartWallet.IVSmartWallet mView) {
        this.mView = mView;
    }


    @Override
    public void pGetInit(String path, Map<String, String> params) {
        mModel.post(path, params, new HttpCallback<WalletBean>(true) {
            @Override
            public void onSuccess(WalletBean dataBean) {
                mView.vGetInitSuccess(dataBean);
            }

            @Override
            public void onFail(String code, String error) {
                ToastUtil.show(error);
            }
        });
    }

}
